<script lang="ts" setup>
import useWinRes, { useWinResRefs } from "../../hooks/useWinRes";
import useImpCpts, { useImpCptsRefs } from "./useImpCpts";
defineOptions({
  name: "WinRes",
  inheritAttrs: true
});
const { style, showWinRes } = useWinResRefs();
const { toggleWinRes } = useWinRes();
const { cpts, curCpt } = useImpCptsRefs();
const { toggleCpt } = useImpCpts();
const { resData } = useWinResRefs();
toggleCpt(resData.value.status);
// console.log(cpts);
</script>
<template>
  <Teleport to="body">
    <van-overlay
      :lock-scroll="false"
      z-index="1002"
      :show="showWinRes"
      @click.stop="toggleWinRes()"
      :style="style"
    >
      <div class="w-full h-full" @click.stop>
        <component :is="cpts[curCpt]" :resData="resData" />
      </div>
    </van-overlay>
  </Teleport>
</template>
